package com.crowd.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Stone
 * @date 2020/6/28 21:29
 */
@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {
    /**
     * @Author:Stone
       * @Param registry:
       * @return: void
     * @Date: 2020/6/28 21:30
     * @Description: 相当于以前xml文件配置里面的mvc:view-controller
    */
    public void addViewControllers(ViewControllerRegistry registry) {
        // 这个方法里面，也是会拼前后缀的，前后缀在yaml文件里面
        String urlPath = "/auth/member/to/reg/page.html";
        String viewName = "member-reg";
        registry.addViewController(urlPath).setViewName(viewName);
    }
}
